def is_leap_year(year):
    if year % 400 == 0 or (year % 4 == 0 and year % 100 != 0):
        return True
    else:
        return False

def get_days_in_month(year, month):
    days_in_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
    if month == 2 and is_leap_year(year):
        return 29
    else:
        return days_in_month[month - 1]

year = int(input("请输入年份："))
month = int(input("请输入月份："))

days = get_days_in_month(year, month)
print(f"{year}年{month}月有{days}天。")
